#include "stdafx.h"
#include "DialogueSequence.h"
#include "ObjectManager.h"
#include "DialogueBox.h"
#include "TalkingDialogueBox.h"

DialogueSequence::DialogueSequence()
{
	m_nCurrentDialogueBox = 0;
	m_eType = BASEOBJECT2D;
}

DialogueSequence::~DialogueSequence()
{
	
}

void DialogueSequence::Update(float _dt)
{
	m_vDialogueBoxes[m_nCurrentDialogueBox]->Update(_dt);
}

void DialogueSequence::Render()
{
	m_vDialogueBoxes[m_nCurrentDialogueBox]->Render();
}

bool DialogueSequence::NextDialogue()
{
	int nSize = (int)m_vDialogueBoxes.size();
	if(m_nCurrentDialogueBox + 1 < nSize)
	{
		m_nCurrentDialogueBox += 1;
		return false; // still more dialogue
	}
	else
	{
		ObjectManager::GetInstance()->RemoveObject(this);
		return true;
	}
}

void DialogueSequence::EndDialogue()
{
	ObjectManager::GetInstance()->RemoveObject(this);
}